package com.example.demo.mapper;

import com.example.demo.entity.Manager;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Date;

@Mapper
public interface ManagerMapper {
    int insertManager(Manager manager);
    int updateManager(Manager manager);
    int deleteManager(Integer id);
    List<Map<String, Object>> selectManagerList(Map<String, Object> params);
    
    int updateManagerStatus(@Param("id") Integer id, @Param("status") Integer status);

    // 通过用户名获取 Manager 对象
    Manager selectManagerByUsername(@Param("username") String username);

    // 通过ID获取 Manager 对象
    Manager selectManagerById(@Param("id") Integer id);

    // 更新密码
    int updateManagerPassword(@Param("id") Integer id, 
                            @Param("password") String password,
                            @Param("update_time") Date update_time);

    // 获取管理员信息和权限菜单
    Map<String, Object> selectManagerInfo(@Param("userId") Integer userId);
}
